home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
doom
/
turric03.zip
/
TURRIC03.ZIP
/
PROGS
/
WEAPONS.QC
< prev
next >
Wrap
Text File
|
1997-02-06
|
66KB
|
2,652 lines
/*
==============================================================================
WEAPONS
==============================================================================
*/
// prototypes
void (entity targ, entity inflictor, entity attacker, float damage) T_Damage;
void () player_run;
void(entity bomb, entity attacker, float rad, entity ignore) T_RadiusDamage;
void(vector org, vector vel, float damage) SpawnBlood;
void() SuperDamageSound;
//** PATCH_BEGIN - throwaxe ****
void() W_ThrowAxe;
//** PATCH_END - throwaxe ******
//** PATCH_BEGIN - tchwpn10 - Turrican ****
void(vector org, vector vec) LaunchLaser;
//** PATCH_END - tchwpn10 - Turrican ******
//** PATCH_BEGIN - lazsight - Turrican ****
void ( entity targ_owner ) LaserTargeterToggle;
//** PATCH_END - lazsight - Turrican ******
// called by worldspawn
void() W_Precache =
{
precache_sound ("weapons/r_exp3.wav"); // new rocket explosion
precache_sound ("weapons/rocket1i.wav"); // spike gun
precache_sound ("weapons/sgun1.wav");
precache_sound ("weapons/guncock.wav"); // player shotgun
precache_sound ("weapons/ric1.wav"); // ricochet (used in c code)
precache_sound ("weapons/ric2.wav"); // ricochet (used in c code)
precache_sound ("weapons/ric3.wav"); // ricochet (used in c code)
precache_sound ("weapons/spike2.wav"); // super spikes
precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code)
precache_sound ("weapons/grenade.wav"); // grenade launcher
precache_sound ("weapons/bounce.wav"); // grenade bounce
precache_sound ("weapons/shotgn2.wav"); // super shotgun
//** PATCH_BEGIN - gibbin3 - Turrican ****
precache_sound ("zombie/z_hit.wav"); // Grenade bounce on corpse.
//** PATCH_END - gibbin3 - Turrican ******
//** PATCH_BEGIN - eatgibs ****
precache_sound ("demon/dhit2.wav"); // for eatin' heads
precache_sound ("zombie/z_miss.wav"); // for eatin' gibs
//** PATCH_END - eatgibs ******
//** PATCH_BEGIN - grap109b ****
precache_sound2 ("blob/land1.wav"); // chain go splorch!
precache_sound ("items/protect3.wav"); // Heheh... fix for cheats
precache_sound ("items/damage2.wav"); // This too
precache_sound ("items/damage3.wav"); // This too
precache_sound ("weapons/chain1.wav"); // chain cranking out
precache_sound ("weapons/chain2.wav"); // chain cranking in
precache_sound ("weapons/chain3.wav"); // chain swaying in breeze
precache_sound ("weapons/bounce2.wav"); // chain release
// precache_sound ("weapons/gotcha.wav"); // annoying comment by player
//** PATCH_END - grap109b ******
//** PATCH_BEGIN - throwaxe ****
precache_model ("progs/throwaxe.mdl"); // ax model
precache_sound ("weapons/woosh.wav"); // WOOSH sound for throwing axe
precache_sound ("weapons/taxhit1.wav"); // new ax hit sound (FROM QTEST)
precache_sound ("weapons/taxhit2.wav"); // new ax hit sound (FROM QTEST)
precache_sound ("weapons/taxhit3.wav"); // new ax hit sound (FROM QTEST)
//** PATCH_END - throwaxe ******
//** PATCH_BEGIN - pipebombs - Turrican ****
precache_model ("progs/v_pipe.mdl");
//** PATCH_END - pipebombs - Turrican ******
//** PATCH_BEGIN - tchwpn10 - Turrican ****
precache_model("progs/v_laser.mdl");
precache_model("progs/v_laser2.mdl");
precache_model2("progs/laser.mdl");
precache_sound2("enforcer/enfire.wav");
precache_sound2("enforcer/enfstop.wav");
//** PATCH_END - tchwpn10 - Turrican ******
//** PATCH_BEGIN - flame thrower - Turrican ****
precache_model ("progs/v_flame.mdl");
precache_model ("progs/flame.mdl");
precache_model ("progs/flame2.mdl");
precache_sound ("weapons/flame.wav");
precache_sound ("player/slimbrn2.wav");
precache_sound ("misc/water1.wav");
precache_sound ("misc/water2.wav");
//** PATCH_END - flame thrower - Turrican ******
//** PATCH_BEGIN - lazsight - Turrican ****
precache_model ("progs/lazsight.mdl");
precache_sound ("weapons/lazsight.wav");
//** PATCH_END - lazsight - Turrican ******
//** PATCH_BEGIN - tracbeam - Turrican ****
precache_sound ("weapons/beep1.wav");
//** PATCH_END - tracbeam - Turrican ******
//** PATCH_BEGIN - throwing stuff - Turrican ****
//** throwing powerups **
precache_model ("progs/quaddama.mdl");
precache_sound ("items/damage.wav");
precache_sound ("items/damage2.wav");
precache_sound ("items/damage3.wav");
precache_model ("progs/invisibl.mdl");
precache_sound ("items/inv1.wav");
precache_sound ("items/inv2.wav");
precache_sound ("items/inv3.wav");
precache_model ("progs/suit.mdl");
precache_sound ("items/suit.wav");
precache_sound ("items/suit2.wav");
precache_model ("progs/invulner.mdl");
precache_sound ("items/protect.wav");
precache_sound ("items/protect2.wav");
precache_sound ("items/protect3.wav");
//** PATCH_END - throwing stuff - Turrucan ******
//** PATCH_BEGIN - morph2 ****
//// Zombie morph
precache_model ("progs/zombie.mdl");
precache_model ("progs/h_zombie.mdl");
precache_model ("progs/zom_gib.mdl");
precache_sound ("zombie/z_idle.wav");
precache_sound ("zombie/z_idle1.wav");
precache_sound ("zombie/z_shot1.wav");
precache_sound ("zombie/z_gib.wav");
precache_sound ("zombie/z_pain.wav");
precache_sound ("zombie/z_pain1.wav");
precache_sound ("zombie/z_fall.wav");
precache_sound ("zombie/z_miss.wav");
precache_sound ("zombie/z_hit.wav");
precache_sound ("zombie/idle_w2.wav");
//** PATCH_BEGIN - morph2 - Turrican ****
precache_sound ("zombie/z_jump.wav");
precache_sound ("zombie/z_landpn.wav");
//** PATCH_END - morph2 - Turrican ******
////
//// Shalrath morph
precache_model2 ("progs/shalrath.mdl");
precache_model2 ("progs/h_shal.mdl");
precache_model2 ("progs/v_spike.mdl");
precache_sound2 ("shalrath/attack.wav");
precache_sound2 ("shalrath/attack2.wav");
precache_sound2 ("shalrath/death.wav");
precache_sound2 ("shalrath/idle.wav");
precache_sound2 ("shalrath/pain.wav");
precache_sound2 ("shalrath/sight.wav");
//** PATCH_BEGIN - morph2 - Turrican ****
precache_sound ("shalrath/srlandpn.wav");
precache_sound ("shalrath/srjump.wav");
//** PATCH_END - morph2 - Turrican ******
////
//// Wizard morph
precache_model ("progs/wizard.mdl");
precache_model ("progs/h_wizard.mdl");
precache_model ("progs/w_spike.mdl");
precache_sound ("wizard/hit.wav"); // used by c code
precache_sound ("wizard/wattack.wav");
precache_sound ("wizard/wdeath.wav");
precache_sound ("wizard/widle1.wav");
precache_sound ("wizard/widle2.wav");
precache_sound ("wizard/wpain.wav");
precache_sound ("wizard/wsight.wav");
//** PATCH_BEGIN - morph2 - Turrican ****
precache_sound ("wizard/wjump.wav");
precache_sound ("wizard/wlandpn.wav");
//** PATCH_END - morph2 - Turrican ******
////
//// Hell knight morph
precache_model2 ("progs/hknight.mdl");
precache_model2 ("progs/k_spike.mdl");
precache_model2 ("progs/h_hellkn.mdl");
precache_sound2 ("hknight/attack1.wav");
precache_sound2 ("hknight/death1.wav");
precache_sound2 ("hknight/pain1.wav");
precache_sound2 ("hknight/sight1.wav");
precache_sound ("hknight/hit.wav"); // used by C code, so don't sound2
precache_sound2 ("hknight/slash1.wav");
precache_sound2 ("hknight/idle.wav");
precache_sound2 ("hknight/grunt.wav");
precache_sound ("knight/sword1.wav");
precache_sound ("knight/sword2.wav");
//** PATCH_BEGIN - morph2 - Turrican ****
precache_sound ("hknight/hklandpn.wav");
precache_sound ("hknight/hkjump1.wav");
//** PATCH_END - morph2 - Turrican ******
////
//// Shambler morph
precache_model ("progs/shambler.mdl");
precache_model ("progs/s_light.mdl");
precache_model ("progs/h_shams.mdl");
precache_model ("progs/bolt.mdl");
precache_sound ("shambler/sattck1.wav");
precache_sound ("shambler/sboom.wav");
precache_sound ("shambler/sdeath.wav");
precache_sound ("shambler/shurt2.wav");
precache_sound ("shambler/sidle.wav");
precache_sound ("shambler/ssight.wav");
precache_sound ("shambler/melee1.wav");
precache_sound ("shambler/melee2.wav");
precache_sound ("shambler/smack.wav");
//** PATCH_BEGIN - morph2 - Turrican ****
precache_sound ("shambler/slandpn.wav");
//** PATCH_END - morph2 - Turrican ******
////
//// Demon morph
precache_model ("progs/demon.mdl");
precache_model ("progs/h_demon.mdl");
precache_sound ("demon/ddeath.wav");
precache_sound ("demon/dhit2.wav");
precache_sound ("demon/djump.wav");
precache_sound ("demon/dpain1.wav");
precache_sound ("demon/idle1.wav");
precache_sound ("demon/sight2.wav");
//** PATCH_BEGIN - morph2 - Turrican ****
precache_sound ("demon/dgrowl.wav");
precache_sound ("demon/dland2.wav");
precache_sound ("demon/dlandpai.wav");
//** PATCH_END - morph2 - Turrican ******
////
//// Ogre morph
precache_model ("progs/ogre.mdl");
precache_model ("progs/h_ogre.mdl");
precache_model ("progs/grenade.mdl");
precache_sound ("ogre/ogdrag.wav");
precache_sound ("ogre/ogdth.wav");
precache_sound ("ogre/ogidle.wav");
precache_sound ("ogre/ogidle2.wav");
precache_sound ("ogre/ogpain1.wav");
precache_sound ("ogre/ogsawatk.wav");
precache_sound ("ogre/ogwake.wav");
//** PATCH_BEGIN - morph2 - Turrican ****
precache_sound ("ogre/oglandpn.wav");
//** PATCH_END - morph2 - Turrican ******
////
//** PATCH_END - morph2 ******
};
float() crandom =
{
return 2*(random() - 0.5);
};
/*
================
W_FireAxe
================
*/
void() W_FireAxe =
{
local vector source;
local vector org;
source = self.origin + '0 0 16';
traceline (source, source + v_forward*64, FALSE, self);
if (trace_fraction == 1.0)
return;
org = trace_endpos - v_forward*4;
if (trace_ent.takedamage)
{
//** PATCH_BEGIN - gibbin3 ****
// Some sort of thunking sound ...
sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM);
//** PATCH_END - gibbin3 ******
trace_ent.axhitme = 1;
SpawnBlood (org, '0 0 0', 20);
T_Damage (trace_ent, self, self, 20);
}
else
{ // hit wall
sound (self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
}
};
//============================================================================
vector() wall_velocity =
{
local vector vel;
vel = normalize (self.velocity);
vel = normalize(vel + v_up*(random()- 0.5) + v_right*(random()- 0.5));
vel = vel + 2*trace_plane_normal;
vel = vel * 200;
return vel;
};
/*
================
SpawnMeatSpray
================
*/
void(vector org, vector vel) SpawnMeatSpray =
{
local entity missile, mpuff;
local vector org;
missile = spawn ();
missile.owner = self;
missile.movetype = MOVETYPE_BOUNCE;
missile.solid = SOLID_NOT;
makevectors (self.angles);
missile.velocity = vel;
missile.velocity_z = missile.velocity_z + 250 + 50*random();
missile.avelocity = '3000 1000 2000';
// set missile duration
missile.nextthink = time + 1;
missile.think = SUB_Remove;
setmodel (missile, "progs/zom_gib.mdl");
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, org);
};
/*
================
SpawnBlood
================
*/
void(vector org, vector vel, float damage) SpawnBlood =
{
particle (org, vel*0.1, 73, damage*2);
};
/*
================
spawn_touchblood
================
*/
void(float damage) spawn_touchblood =
{
local vector vel;
vel = wall_velocity () * 0.2;
SpawnBlood (self.origin + vel*0.01, vel, damage);
};
/*
================
SpawnChunk
================
*/
void(vector org, vector vel) SpawnChunk =
{
particle (org, vel*0.02, 0, 10);
};
/*
==============================================================================
MULTI-DAMAGE
Collects multiple small damages into a single damage
==============================================================================
*/
entity multi_ent;
float multi_damage;
void() ClearMultiDamage =
{
multi_ent = world;
multi_damage = 0;
};
void() ApplyMultiDamage =
{
if (!multi_ent)
return;
T_Damage (multi_ent, self, self, multi_damage);
};
void(entity hit, float damage) AddMultiDamage =
{
if (!hit)
return;
if (hit != multi_ent)
{
ApplyMultiDamage ();
multi_damage = damage;
multi_ent = hit;
}
else
multi_damage = multi_damage + damage;
};
/*
==============================================================================
BULLETS
==============================================================================
*/
/*
================
TraceAttack
================
*/
void(float damage, vector dir) TraceAttack =
{
local vector vel, org;
vel = normalize(dir + v_up*crandom() + v_right*crandom());
vel = vel + 2*trace_plane_normal;
vel = vel * 200;
org = trace_endpos - dir*4;
if (trace_ent.takedamage)
{
SpawnBlood (org, vel*0.2, damage);
AddMultiDamage (trace_ent, damage);
}
else
{
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
}
};
/*
================
FireBullets
Used by shotgun, super shotgun, and enemy soldier firing
Go to the trouble of combining multiple pellets into a single damage call.
================
*/
void(float shotcount, vector dir, vector spread) FireBullets =
{
local vector direction;
local vector src;
makevectors(self.v_angle);
src = self.origin + v_forward*10;
src_z = self.absmin_z + self.size_z * 0.7;
ClearMultiDamage ();
while (shotcount > 0)
{
direction = dir + crandom()*spread_x*v_right + crandom()*spread_y*v_up;
traceline (src, src + direction*2048, FALSE, self);
if (trace_fraction != 1.0)
TraceAttack (4, direction);
shotcount = shotcount - 1;
}
ApplyMultiDamage ();
};
/*
================
W_FireShotgun
================
*/
void() W_FireShotgun =
{
local vector dir;
sound (self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM);
self.punchangle_x = -2;
self.currentammo = self.ammo_shells = self.ammo_shells - 1;
dir = aim (self, 100000);
FireBullets (6, dir, '0.04 0.04 0');
};
/*
================
W_FireSuperShotgun
================
*/
void() W_FireSuperShotgun =
{
local vector dir;
if (self.currentammo == 1)
{
W_FireShotgun ();
return;
}
sound (self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);
self.punchangle_x = -4;
self.currentammo = self.ammo_shells = self.ammo_shells - 2;
dir = aim (self, 100000);
FireBullets (14, dir, '0.14 0.08 0');
};
//** PATCH_BEGIN - tchwpn10 - Turrican ****
/*
==============================================================================
LASERS
==============================================================================
*/
/*
================
W_FireLaser
================
*/
void() W_FireLaser =
{
local vector dir, org;
sound(self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
org = self.origin + v_forward * 8 + '0 0 16';
self.punchangle_x = -1;
self.currentammo = self.ammo_cells = self.ammo_cells - 1;
dir = aim (self, 100000);
LaunchLaser(org, dir);
};
/*
================
W_FireSuperLaser
================
*/
void() W_FireSuperLaser =
{
local vector dir, orgleft, orgright;
if (self.currentammo == 1)
{
W_FireLaser ();
return;
}
sound(self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
self.punchangle_x = CONTENT_SOLID;
orgleft = self.origin + v_forward * 8 - v_right + '0 0 16';
orgright = self.origin + v_forward * 8 + v_right + '0 0 16';
self.currentammo = self.ammo_cells = self.ammo_cells - 2;
dir = aim (self, 10000);
LaunchLaser(orgleft, dir);
LaunchLaser(orgright, dir);
};
//** PATCH_END - tchwpn10 - Turrican ******
/*
==============================================================================
ROCKETS
==============================================================================
*/
void() s_explode1 = [0, s_explode2] {};
void() s_explode2 = [1, s_explode3] {};
void() s_explode3 = [2, s_explode4] {};
void() s_explode4 = [3, s_explode5] {};
void() s_explode5 = [4, s_explode6] {};
void() s_explode6 = [5, SUB_Remove] {};
void() BecomeExplosion =
{
self.movetype = MOVETYPE_NONE;
self.velocity = '0 0 0';
self.touch = SUB_Null;
setmodel (self, "progs/s_explod.spr");
self.solid = SOLID_NOT;
s_explode1 ();
};
void() T_MissileTouch =
{
local float damg;
if (other == self.owner)
return; // don't explode on owner
if (pointcontents(self.origin) == CONTENT_SKY)
{
remove(self);
return;
}
damg = 100 + random()*20;
if (other.health)
{
if (other.classname == "monster_shambler")
damg = damg * 0.5; // mostly immune
T_Damage (other, self, self.owner, damg );
}
// don't do radius damage to the other, because all the damage
// was done in the impact
T_RadiusDamage (self, self.owner, 120, other);
// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
self.origin = self.origin - 8*normalize(self.velocity);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
BecomeExplosion ();
};
/*
================
W_FireRocket
================
*/
void() W_FireRocket =
{
local entity missile, mpuff;
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM);
self.punchangle_x = -2;
missile = spawn ();
missile.owner = self;
missile.movetype = MOVETYPE_FLYMISSILE;
missile.solid = SOLID_BBOX;
// set missile speed
makevectors (self.v_angle);
missile.velocity = aim(self, 1000);
missile.velocity = missile.velocity * 1000;
missile.angles = vectoangles(missile.velocity);
missile.touch = T_MissileTouch;
// set missile duration
missile.nextthink = time + 5;
missile.think = SUB_Remove;
setmodel (missile, "progs/missile.mdl");
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, self.origin + v_forward*8 + '0 0 16');
};
/*
===============================================================================
LIGHTNING
===============================================================================
*/
/*
=================
LightningDamage
=================
*/
void(vector p1, vector p2, entity from, float damage) LightningDamage =
{
local entity e1, e2;
local vector f;
f = p2 - p1;
normalize (f);
f_x = 0 - f_y;
f_y = f_x;
f_z = 0;
f = f*16;
e1 = e2 = world;
traceline (p1, p2, FALSE, self);
if (trace_ent.takedamage)
{
particle (trace_endpos, '0 0 100', 225, damage*4);
T_Damage (trace_ent, from, from, damage);
if (self.classname == "player")
{
if (other.classname == "player")
trace_ent.velocity_z = trace_ent.velocity_z + 400;
}
}
e1 = trace_ent;
traceline (p1 + f, p2 + f, FALSE, self);
if (trace_ent != e1 && trace_ent.takedamage)
{
particle (trace_endpos, '0 0 100', 225, damage*4);
T_Damage (trace_ent, from, from, damage);
}
e2 = trace_ent;
traceline (p1 - f, p2 - f, FALSE, self);
if (trace_ent != e1 && trace_ent != e2 && trace_ent.takedamage)
{
particle (trace_endpos, '0 0 100', 225, damage*4);
T_Damage (trace_ent, from, from, damage);
}
};
void() W_FireLightning =
{
local vector org;
if (self.ammo_cells < 1)
{
self.weapon = W_BestWeapon ();
W_SetCurrentAmmo ();
return;
}
// explode if under water
if (self.waterlevel > 1)
{
T_RadiusDamage (self, self, 35*self.ammo_cells, world);
self.ammo_cells = 0;
W_SetCurrentAmmo ();
return;
}
if (self.t_width < time)
{
sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
self.t_width = time + 0.6;
}
self.punchangle_x = -2;
self.currentammo = self.ammo_cells = self.ammo_cells - 1;
org = self.origin + '0 0 16';
traceline (org, org + v_forward*600, TRUE, self);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
WriteEntity (MSG_BROADCAST, self);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
WriteCoord (MSG_BROADCAST, trace_endpos_x);
WriteCoord (MSG_BROADCAST, trace_endpos_y);
WriteCoord (MSG_BROADCAST, trace_endpos_z);
LightningDamage (self.origin, trace_endpos + v_forward*4, self, 30);
};
//=============================================================================
void() GrenadeExplode =
{
T_RadiusDamage (self, self.owner, 120, world);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
BecomeExplosion ();
};
void() GrenadeTouch =
{
if (other == self.owner)
return; // don't explode on owner
if (other.takedamage == DAMAGE_AIM)
{
GrenadeExplode();
return;
}
//** PATCH_BEGIN - gibbin3 - Turrican ****
if (other.classname == "corpse" ||
other.classname == "gib" ||
other.classname == "gib_head")
{
sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); // bounce on corpse sound
}
else
{
sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound
}
//** PATCH_END - gibbin3 - Turrican ******
if (self.velocity == '0 0 0')
self.avelocity = '0 0 0';
};
/*
================
W_FireGrenade
================
*/
void() W_FireGrenade =
{
local entity missile, mpuff;
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
self.punchangle_x = -2;
missile = spawn ();
missile.owner = self;
missile.movetype = MOVETYPE_BOUNCE;
missile.solid = SOLID_BBOX;
missile.classname = "grenade";
// set missile speed
makevectors (self.v_angle);
if (self.v_angle_x)
missile.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
else
{
missile.velocity = aim(self, 10000);
missile.velocity = missile.velocity * 600;
missile.velocity_z = 200;
}
missile.avelocity = '300 300 300';
missile.angles = vectoangles(missile.velocity);
missile.touch = GrenadeTouch;
// set missile duration
//** PATCH_BEGIN - grenades - Turrican ****
missile.nextthink = time + self.grenade_time;
//** PATCH_END - grenades - Turrican ******
missile.think = GrenadeExplode;
setmodel (missile, "progs/grenade.mdl");
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, self.origin);
};
//** PATCH_BEGIN - pipebombs ****
//Detonate all pipebombs
void() DetPipeBombs =
{
local entity head;
head = find (world,classname,"pipebomb");
while(head)
{
if(head.owner == self)
head.nextthink = time;
head = find (head,classname,"pipebomb");
}
};
void() PipeBombTouch =
{
if (other == self.owner)
return; // don't explode on owner
sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound
if (self.velocity == '0 0 0')
self.avelocity = '0 0 0';
};
void() W_FirePipeBomb =
{
local entity missile, mpuff;
if(self.ammo_rockets < 1) // have to have ammo
return;
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
self.punchangle_x=-2;
missile = spawn ();
missile.owner = self;
missile.movetype = MOVETYPE_BOUNCE;
missile.solid = SOLID_BBOX;
missile.classname = "pipebomb";
makevectors (self.v_angle);
if (self.v_angle_x) missile.velocity =
v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
else {
missile.velocity = aim(self, 10000);
missile.velocity = missile.velocity * 600;
missile.velocity_z = 200;
}
missile.avelocity = '300 300 300';
missile.angles = vectoangles(missile.velocity);
missile.touch = PipeBombTouch;
missile.think = GrenadeExplode;
sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
setmodel (missile, "progs/grenade.mdl");
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, self.origin);
//pipe bombs explode after 5 mins by default
missile.nextthink=time+300;
};
//** PATCH_END - pipebombs ****
//=============================================================================
void() spike_touch;
void() superspike_touch;
/*
===============
launch_spike
Used for both the player and the ogre
===============
*/
void(vector org, vector dir) launch_spike =
{
newmis = spawn ();
newmis.owner = self;
newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.solid = SOLID_BBOX;
newmis.angles = vectoangles(dir);
newmis.touch = spike_touch;
newmis.classname = "spike";
newmis.think = SUB_Remove;
newmis.nextthink = time + 6;
setmodel (newmis, "progs/spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
setorigin (newmis, org);
newmis.velocity = dir * 1000;
};
void() W_FireSuperSpikes =
{
local vector dir;
local entity old;
sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 2;
dir = aim (self, 1000);
launch_spike (self.origin + '0 0 16', dir);
newmis.touch = superspike_touch;
setmodel (newmis, "progs/s_spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
self.punchangle_x = -2;
};
void(float ox) W_FireSpikes =
{
local vector dir;
local entity old;
makevectors (self.v_angle);
if (self.ammo_nails >= 2 && self.weapon == IT_SUPER_NAILGUN)
{
W_FireSuperSpikes ();
return;
}
if (self.ammo_nails < 1)
{
self.weapon = W_BestWeapon ();
W_SetCurrentAmmo ();
return;
}
sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 1;
dir = aim (self, 1000);
launch_spike (self.origin + '0 0 16' + v_right*ox, dir);
self.punchangle_x = -2;
};
.float hit_z;
void() spike_touch =
{
local float rand;
if (other == self.owner)
return;
if (other.solid == SOLID_TRIGGER)
return; // trigger field, do nothing
if (pointcontents(self.origin) == CONTENT_SKY)
{
remove(self);
return;
}
// hit something that bleeds
if (other.takedamage)
{
spawn_touchblood (9);
T_Damage (other, self, self.owner, 9);
}
else
{
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
if (self.classname == "wizspike")
WriteByte (MSG_BROADCAST, TE_WIZSPIKE);
else if (self.classname == "knightspike")
WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE);
else
WriteByte (MSG_BROADCAST, TE_SPIKE);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
}
remove(self);
};
void() superspike_touch =
{
local float rand;
if (other == self.owner)
return;
if (other.solid == SOLID_TRIGGER)
return; // trigger field, do nothing
if (pointcontents(self.origin) == CONTENT_SKY)
{
remove(self);
return;
}
// hit something that bleeds
if (other.takedamage)
{
spawn_touchblood (18);
T_Damage (other, self, self.owner, 18);
}
else
{
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_SUPERSPIKE);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
}
remove(self);
};
/*
===============================================================================
PLAYER WEAPON USE
===============================================================================
*/
void() W_SetCurrentAmmo =
{
player_run (); // get out of any weapon firing states
self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) );
if (self.weapon == IT_AXE)
{
self.currentammo = 0;
self.weaponmodel = "progs/v_axe.mdl";
self.weaponframe = 0;
}
//** PATCH_BEGIN - throwaxe ****
else if (self.weapon == IT_THROWING_AXE)
{
self.currentammo = self.num_axes;
self.weaponmodel = "progs/v_axe.mdl";
self.weaponframe = 0;
}
//** PATCH_END - throwaxe ******
//** PATCH_BEGIN - grap109b ****
else if (self.weapon == IT_MORNINGSTAR)
{
self.currentammo = 0;
self.weaponmodel = "progs/v_star.mdl";
self.weaponframe = 0;
}
//** PATCH_END - grap109b ******
else if (self.weapon == IT_SHOTGUN)
{
self.currentammo = self.ammo_shells;
self.weaponmodel = "progs/v_shot.mdl";
self.weaponframe = 0;
self.items = self.items | IT_SHELLS;
}
else if (self.weapon == IT_SUPER_SHOTGUN)
{
self.currentammo = self.ammo_shells;
self.weaponmodel = "progs/v_shot2.mdl";
self.weaponframe = 0;
self.items = self.items | IT_SHELLS;
}
//** PATCH_BEGIN - tchwpn10 - Turrican ****
else if (self.weapon == IT_LASER)
{
self.currentammo = self.ammo_cells;
self.weaponmodel = "progs/v_laser.mdl";
self.weaponframe = 0;
self.items = self.items | IT_CELLS;
}
else if (self.weapon == IT_SUPER_LASER)
{
self.currentammo = self.ammo_cells;
self.weaponmodel = "progs/v_laser2.mdl";
self.weaponframe = 0;
self.items = self.items | IT_CELLS;
}
//** PATCH_END - tchwpn10 - Turrican ******
else if (self.weapon == IT_NAILGUN)
{
self.currentammo = self.ammo_nails;
self.weaponmodel = "progs/v_nail.mdl";
self.weaponframe = 0;
self.items = self.items | IT_NAILS;
}
else if (self.weapon == IT_SUPER_NAILGUN)
{
self.currentammo = self.ammo_nails;
self.weaponmodel = "progs/v_nail2.mdl";
self.weaponframe = 0;
self.items = self.items | IT_NAILS;
}
else if (self.weapon == IT_GRENADE_LAUNCHER)
{
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_rock.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
}
//** PATCH_BEGIN - pipebombs - Turrican ****
else if (self.weapon == IT_PIPE_BOMBS)
{
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_pipe.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
}
//** PATCH_END - pipebombs - Turrican ******
else if (self.weapon == IT_ROCKET_LAUNCHER)
{
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_rock2.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
}
//** PATCH_BEGIN - flame thrower - Turrican ****
else if (self.weapon == IT_FLAMETHROWER)
{
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_flame.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
}
//** PATCH_END - flame thrower - Turrican ******
else if (self.weapon == IT_LIGHTNING)
{
self.currentammo = self.ammo_cells;
self.weaponmodel = "progs/v_light.mdl";
self.weaponframe = 0;
self.items = self.items | IT_CELLS;
}
//** PATCH_BEGIN - tracbeam - Turrican ****
else if (self.weapon == IT_TRACTOR_BEAM)
{
self.currentammo = self.ammo_cells;
self.weaponmodel = "progs/v_light.mdl";
self.weaponframe = 0;
self.items = self.items | IT_CELLS;
}
//** PATCH_END - tracbeam - Turrican ******
else
{
self.currentammo = 0;
self.weaponmodel = "";
self.weaponframe = 0;
}
};
float() W_BestWeapon =
{
local float it;
//** PATCH_BEGIN - extra weapons - Turrican ****
local float extra_it;
extra_it = self.extra_items;
//** PATCH_END - extra weapons - Turrican ******
it = self.items;
//** PATCH_BEGIN - throwaxe ****
if(self.num_axes == 0 && self.weapon == IT_THROWING_AXE)
return IT_AXE;
else if(self.ammo_cells >= 1 && (it & IT_LIGHTNING) )
//** PATCH_END - throwaxe ******
return IT_LIGHTNING;
else if(self.ammo_nails >= 2 && (it & IT_SUPER_NAILGUN) )
return IT_SUPER_NAILGUN;
//** PATCH_BEGIN - flame thrower - Turrican ****
else if(self.ammo_rockets >= 1 &&
(extra_it & EXTRA_FLAMETHROWER)&&
(it & IT_ROCKET_LAUNCHER) )
return IT_FLAMETHROWER;
//** PATCH_END - flame thrower - Turrican ******
else if(self.ammo_shells >= 2 && (it & IT_SUPER_SHOTGUN) )
return IT_SUPER_SHOTGUN;
else if(self.ammo_nails >= 1 && (it & IT_NAILGUN) )
return IT_NAILGUN;
//** PATCH_BEGIN - tchwpn10 - Turrican ****
else if(self.ammo_cells >= 2 &&
(extra_it & EXTRA_SUPER_LASER) &&
(it & IT_SUPER_SHOTGUN) )
return IT_SUPER_LASER;
else if(self.ammo_cells >= 1 && (extra_it & EXTRA_LASER) )
return IT_LASER;
//** PATCH_END - tchwpn10 - Turrican ******
else if(self.ammo_shells >= 1 && (it & IT_SHOTGUN) )
return IT_SHOTGUN;
//** PATCH_BEGIN - throwaxe - Turrican ****
else if(self.num_axes >= 1 && (extra_it & EXTRA_THROWING_AXE) )
return IT_THROWING_AXE;
//** PATCH_END - throwaxe - Turrican ******
/*
if(self.ammo_rockets >= 1 && (it & IT_ROCKET_LAUNCHER) )
return IT_ROCKET_LAUNCHER;
else if(self.ammo_rockets >= 1 && (it & IT_GRENADE_LAUNCHER) )
return IT_GRENADE_LAUNCHER;
//** PATCH_BEGIN - pipebombs - Turrican ****
else if(self.ammo_rockets >= 1 &&
(extra_it & EXTRA_PIPE_BOMBS) &&
(it & IT_GRENADE_LAUNCHER) )
return IT_PIPE_BOMBS;
//** PATCH_END - pipebombs - Turrican ******
//** PATCH_BEGIN - tracbeam - Turrican ****
else if(self.ammo_cells >= 1 &&
(extra_it & EXTRA_PIPE_BOMBS) &&
(it & IT_LIGHTNING) )
return IT_TRACTOR_BEAM;
//** PATCH_END - tracbeam - Turrican ******
*/
//** PATCH_BEGIN - grap109b ****
return IT_MORNINGSTAR;
//** PATCH_END - grap109b ******
};
float() W_CheckNoAmmo =
{
if (self.currentammo > 0)
return TRUE;
if (self.weapon == IT_AXE)
return TRUE;
//** PATCH_BEGIN - grap109b ****
if (self.weapon == IT_MORNINGSTAR)
return TRUE;
//** PATCH_END - grap109b ******
self.weapon = W_BestWeapon ();
W_SetCurrentAmmo ();
// drop the weapon down
return FALSE;
};
/*
============
W_Attack
An attack impulse can be triggered now
============
*/
void() player_axe1;
void() player_axeb1;
void() player_axec1;
void() player_axed1;
void() player_shot1;
void() player_nail1;
void() player_light1;
void() player_rocket1;
//** PATCH_BEGIN - grap109b ****
void() player_chain1;
void() player_chain3;
//** PATCH_END - grap109b ******
//** PATCH_BEGIN - throwaxe ****
void() player_tax1;
//** PATCH_END - throwaxe ******
void() W_Attack =
{
local float r;
//** PATCH_BEGIN - morph2 ****
if (self._attack != SUB_Null)
{
self._attack();
return;
}
//** PATCH_END - morph2 ******
if (!W_CheckNoAmmo ())
return;
makevectors (self.v_angle); // calculate forward angle for velocity
self.show_hostile = time + 1; // wake monsters up
if (self.weapon == IT_AXE)
{
sound (self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
r = random();
if (r < 0.25)
player_axe1 ();
else if (r<0.5)
player_axeb1 ();
else if (r<0.75)
player_axec1 ();
else
player_axed1 ();
self.attack_finished = time + 0.5;
}
//** PATCH_BEGIN - throwaxe ****
else if (self.weapon == IT_THROWING_AXE)
{
player_tax1 ();
self.attack_finished = time + 1;
}
//** PATCH_END - throwaxe ******
//** PATCH_BEGIN - grap109b ****
else if (self.weapon == IT_MORNINGSTAR)
{
if (!self.hook_out)
{
player_chain1();
}
else
{
player_chain3();
}
self.attack_finished = time + 0.1;
}
//** PATCH_END - grap109b ******
else if (self.weapon == IT_SHOTGUN)
{
player_shot1 ();
W_FireShotgun ();
self.attack_finished = time + 0.5;
}
else if (self.weapon == IT_SUPER_SHOTGUN)
{
player_shot1 ();
W_FireSuperShotgun ();
self.attack_finished = time + 0.7;
}
//** PATCH_BEGIN - tchwpn10 - Turrican ****
else if (self.weapon == IT_LASER)
{
player_shot1 ();
W_FireLaser ();
self.attack_finished = time + 0.25;
}
else if (self.weapon == IT_SUPER_LASER)
{
player_shot1 ();
W_FireSuperLaser ();
self.attack_finished = time + 0.5;
}
//** PATCH_END - tchwpn10 - Turrican ******
else if (self.weapon == IT_NAILGUN)
{
player_nail1 ();
}
else if (self.weapon == IT_SUPER_NAILGUN)
{
player_nail1 ();
}
else if (self.weapon == IT_GRENADE_LAUNCHER)
{
player_rocket1();
W_FireGrenade();
self.attack_finished = time + 0.6;
}
//** PATCH_BEGIN - pipebombs ****
else if (self.weapon == IT_PIPE_BOMBS)
{
player_rocket1();
W_FirePipeBomb();
self.attack_finished = time + 0.6;
}
//** PATCH_END - pipebombs ******
else if (self.weapon == IT_ROCKET_LAUNCHER)
{
player_rocket1();
W_FireRocket();
self.attack_finished = time + 0.8;
}
//** PATCH_BEGIN - flame thrower - Turrican ****
else if (self.weapon == IT_FLAMETHROWER)
{
player_shot1();
W_FireFlame();
self.attack_finished = time + 0.03;
}
//** PATCH_END - flame thrower - Turrican ******
else if (self.weapon == IT_LIGHTNING)
{
player_light1();
self.attack_finished = time + 0.1;
sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM);
}
//** PATCH_BEGIN - tracbeam - Turrican ****
else if (self.weapon == IT_TRACTOR_BEAM)
{
player_light1();
self.attack_finished = time + 0.1;
sound (self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM);
}
//** PATCH_END - tracbeam - Turrican ******
};
//** PATCH_BEGIN - general change - Turrican ****
/*
============
W_NotifyOfChange
============
*/
void() W_NotifyOfChange =
{
if (self.weapon == IT_AXE)
sprint(self,"Normal Axe\n");
else if (self.weapon == IT_THROWING_AXE)
sprint(self,"Throwing Axe\n");
else if (self.weapon == IT_MORNINGSTAR)
sprint(self,"Morning Star\n");
else if (self.weapon == IT_SHOTGUN)
sprint(self,"Shotgun\n");
else if (self.weapon == IT_SUPER_SHOTGUN)
sprint(self,"Super Shotgun\n");
else if (self.weapon == IT_LASER)
sprint(self,"Laser\n");
else if (self.weapon == IT_SUPER_LASER)
sprint(self,"Super Laser\n");
else if (self.weapon == IT_NAILGUN)
sprint(self,"Nailgun\n");
else if (self.weapon == IT_SUPER_NAILGUN)
sprint(self,"Super Nailgun\n");
else if (self.weapon == IT_GRENADE_LAUNCHER)
sprint(self,"Grenade Launcher\n");
else if (self.weapon == IT_PIPE_BOMBS)
sprint(self,"Pipe Bombs\n");
else if (self.weapon == IT_FLAMETHROWER)
sprint(self,"Flamethrower\n");
else if (self.weapon == IT_ROCKET_LAUNCHER)
sprint(self,"Rocket Launcher\n");
else if (self.weapon == IT_LIGHTNING)
sprint(self,"Lightning Gun\n");
else if (self.weapon == IT_TRACTOR_BEAM)
sprint(self,"Tractor Beam\n");
};
//** PATCH_END - general change - Turrican ******
/*
============
W_ChangeWeapon
============
*/
void() W_ChangeWeapon =
{
//** PATCH_BEGIN - extra weapons - Turrican ****
local float am, fl;
local float extra_weapon;
//** PATCH_END - extra weapons - Turrican ******
am = 0;
if (self.impulse == 1)
{
//** PATCH_BEGIN - throwaxe - Turrican ****
//** PATCH_BEGIN - grap109b - Turrican ****
// Cycle the axes.
if (self.weapon == IT_AXE && self.num_axes >= 1)
{
fl = IT_THROWING_AXE;
}
else if ((self.weapon == IT_AXE) || (self.weapon == IT_THROWING_AXE))
{
fl = IT_MORNINGSTAR;
}
else
{
fl = IT_AXE;
}
//** PATCH_END - grap109b - Turrican ******
//** PATCH_END - throwaxe - Turrican ******
}
else if (self.impulse == 2)
{
fl = IT_SHOTGUN;
if (self.ammo_shells < 1)
am = 1;
}
else if (self.impulse == 3)
{
//** PATCH_BEGIN - extra weapons - Turrican ****
// Swap between the two shottys, with the super shotty coming up first.
if(self.weapon == IT_SUPER_SHOTGUN)
{
fl = IT_SHOTGUN;
if (self.ammo_shells < 1)
am = 1;
}
else
{
fl = IT_SUPER_SHOTGUN;
if (self.ammo_shells < 2)
am = 1;
}
//** PATCH_END - extra weapons - Turrican ******
}
else if (self.impulse == 4)
{
//** PATCH_BEGIN - tchwpn10 - Turrican ****
// Swap between the two lasers, with the super laser coming up first.
if(self.weapon == IT_SUPER_LASER)
{
fl = IT_LASER;
if (self.ammo_cells < 1)
am = 1;
}
else if(self.items & IT_SUPER_SHOTGUN)
{
fl = IT_SUPER_LASER;
if (self.ammo_cells < 2)
am = 1;
}
else
{
fl = IT_LASER;
if (self.ammo_cells < 1)
am = 1;
}
//** PATCH_END - tchwpn10 - Turrican ******
}
else if (self.impulse == 5)
{
//** PATCH_BEGIN - extra weapons - Turrican ****
// Swap between the two nailguns, with the super nailgun coming up first.
if(self.weapon == IT_SUPER_NAILGUN)
{
fl = IT_NAILGUN;
if (self.ammo_nails < 1)
am = 1;
}
else if(self.items & IT_SUPER_NAILGUN)
{
fl = IT_SUPER_NAILGUN;
if (self.ammo_nails < 2)
am = 1;
}
else
{
fl = IT_NAILGUN;
if (self.ammo_nails < 1)
am = 1;
}
//** PATCH_END - extra weapons - Turrican ******
}
else if (self.impulse == 6)
{
//** PATCH_BEGIN - pipebombs ****
// Swap between grenades and pipe bombs.
if (self.weapon == IT_GRENADE_LAUNCHER)
{
fl = IT_PIPE_BOMBS;
}
else
{
fl = IT_GRENADE_LAUNCHER;
}
//** PATCH_END - pipebombs ******
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.impulse == 7)
{
//** PATCH_BEGIN - flame thrower - Turrican ****
// Swap between rocket launcher and flamethrower.
if (self.weapon == IT_ROCKET_LAUNCHER)
{
fl = IT_FLAMETHROWER;
}
else
{
fl = IT_ROCKET_LAUNCHER;
}
//** PATCH_END - flame thrower - Turrican ******
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.impulse == 8)
{
//** PATCH_BEGIN - flame thrower - Turrican ****
// Swap between lightning gun and tractor beam.
if (self.weapon == IT_LIGHTNING)
{
fl = IT_TRACTOR_BEAM;
}
else
{
fl = IT_LIGHTNING;
}
//** PATCH_END - flame thrower - Turrican ******
if (self.ammo_cells < 1)
am = 1;
}
//** PATCH_BEGIN - grap109b - Turrican ****
else if (self.impulse == 100)
{
// Toggle morningstar.
if (self.weapon == IT_MORNINGSTAR)
{
fl = self.prev_weapon;
self.prev_weapon = IT_MORNINGSTAR;
}
else
{
self.prev_weapon = self.weapon;
fl = IT_MORNINGSTAR;
}
}
//** PATCH_END - grap109b - Turrican ******
self.impulse = 0;
//** PATCH_BEGIN - extra weapons - Turrican ****
if (fl == IT_MORNINGSTAR ||
fl == IT_THROWING_AXE ||
fl == IT_LASER ||
fl == IT_SUPER_LASER ||
fl == IT_PIPE_BOMBS ||
fl == IT_FLAMETHROWER ||
fl == IT_TRACTOR_BEAM)
{
// Get EXTRA weapon number from weapon IT number.
if (fl == IT_MORNINGSTAR)
extra_weapon = EXTRA_MORNINGSTAR;
else if (fl == IT_THROWING_AXE)
extra_weapon = EXTRA_THROWING_AXE;
else if (fl == IT_LASER)
extra_weapon = EXTRA_LASER;
else if (fl == IT_SUPER_LASER && (self.items & IT_SUPER_SHOTGUN))
extra_weapon = EXTRA_SUPER_LASER;
else if (fl == IT_PIPE_BOMBS && (self.items & IT_GRENADE_LAUNCHER))
extra_weapon = EXTRA_PIPE_BOMBS;
else if (fl == IT_FLAMETHROWER && (self.items & IT_ROCKET_LAUNCHER))
extra_weapon = EXTRA_FLAMETHROWER;
else if (fl == IT_TRACTOR_BEAM && (self.items & IT_LIGHTNING))
extra_weapon = EXTRA_TRACTOR_BEAM;
else
extra_weapon = EXTRA_NO_WEAPON;
if (!(self.extra_items & extra_weapon))
{ // don't have the weapon or the ammo
sprint (self, "no weapon\n");
return;
}
}
else
{
if (!(self.items & fl))
{ // don't have the weapon or the ammo
sprint (self, "no weapon\n");
return;
}
}
//** PATCH_END - extra weapons - Turrican ******
if (am)
{ // don't have the ammo
sprint (self, "not enough ammo\n");
return;
}
//
// set weapon, set ammo
//
self.weapon = fl;
W_NotifyOfChange ();
W_SetCurrentAmmo ();
};
/*
============
CheatCommand
============
*/
void() CheatCommand =
{
if (deathmatch || coop)
return;
//** PATCH_BEGIN - morph2 - Turrican ****
if(self.morphnum != M_HUMAN)
{
if(self.morphnum == M_OGRE)
{
self.ammo_rockets = 100;
self.currentammo = self.ammo_rockets;
self.weapon = IT_GRENADE_LAUNCHER;
self.items = self.items | IT_ROCKETS;
}
self.health = 100 * self.health_modifier;
return;
}
//** PATCH_END - morph2 - Turrican ******
self.ammo_rockets = 100;
self.ammo_nails = 200;
self.ammo_shells = 100;
//** PATCH_BEGIN - throwaxe ****
self.num_axes = 100;
//** PATCH_END - throwaxe ******
self.items = self.items |
IT_AXE |
IT_SHOTGUN |
IT_SUPER_SHOTGUN |
IT_NAILGUN |
IT_SUPER_NAILGUN |
IT_GRENADE_LAUNCHER |
IT_ROCKET_LAUNCHER |
IT_KEY1 | IT_KEY2;
//** PATCH_BEGIN - extra weapons - Turrican ****
self.extra_items = self.extra_items |
EXTRA_MORNINGSTAR |
EXTRA_THROWING_AXE |
EXTRA_LASER |
EXTRA_SUPER_LASER |
EXTRA_PIPE_BOMBS |
EXTRA_FLAMETHROWER |
EXTRA_TRACTOR_BEAM;
//** PATCH_END - extra weapons - Turrican ******
self.ammo_cells = 200;
self.items = self.items | IT_LIGHTNING;
self.weapon = IT_ROCKET_LAUNCHER;
self.impulse = 0;
W_SetCurrentAmmo ();
//** PATCH_BEGIN - general change - Turrican ****
// Added health and armor to the general weapon cheat.
self.armortype = 0.8;
self.armorvalue = 200;
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3;
self.health = 100;
//** PATCH_END - general change - Turrican ******
};
/*
============
CycleWeaponCommand
Go to the next weapon with ammo
============
*/
void() CycleWeaponCommand =
{
//** PATCH_BEGIN - extra weapons - Turrican ****
local float am;
local float extra_weapon;
//** PATCH_END - extra weapons - Turrican ******
self.impulse = 0;
while (1)
{
am = 0;
if (self.weapon == IT_LIGHTNING)
{
//** PATCH_BEGIN - tracbeam - Turrican ****
self.weapon = IT_TRACTOR_BEAM;
if (self.ammo_cells < 1)
am = 1;
}
else if (self.weapon == IT_TRACTOR_BEAM)
{
//** PATCH_END - tracbeam - Turrican ******
//** PATCH_BEGIN - throwaxe - Turrican ****
//** PATCH_BEGIN - grap109b - Turrican ****
// Cycle the axes.
self.weapon = IT_AXE;
}
else if (self.weapon == IT_AXE && self.num_axes >= 1)
{
self.weapon = IT_THROWING_AXE;
}
else if ((self.weapon == IT_AXE) || (self.weapon == IT_THROWING_AXE))
{
self.weapon = IT_MORNINGSTAR;
}
else if (self.weapon == IT_MORNINGSTAR)
//** PATCH_END - grap109b - Turrican ******
//** PATCH_END - throwaxe - Turrican ******
{
self.weapon = IT_SHOTGUN;
if (self.ammo_shells < 1)
am = 1;
}
else if (self.weapon == IT_SHOTGUN)
{
self.weapon = IT_SUPER_SHOTGUN;
if (self.ammo_shells < 2)
am = 1;
}
else if (self.weapon == IT_SUPER_SHOTGUN)
{
//** PATCH_BEGIN - tchwpn10 - Turrican ****
self.weapon = IT_LASER;
if (self.ammo_cells < 1)
am = 1;
}
else if (self.weapon == IT_LASER)
{
self.weapon = IT_SUPER_LASER;
if (self.ammo_cells < 2)
am = 1;
}
else if (self.weapon == IT_SUPER_LASER)
{
//** PATCH_END - tchwpn10 - Turrican ******
self.weapon = IT_NAILGUN;
if (self.ammo_nails < 1)
am = 1;
}
else if (self.weapon == IT_NAILGUN)
{
self.weapon = IT_SUPER_NAILGUN;
if (self.ammo_nails < 2)
am = 1;
}
else if (self.weapon == IT_SUPER_NAILGUN)
{
//** PATCH_BEGIN - pipebombs ****
self.weapon = IT_GRENADE_LAUNCHER;
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.weapon == IT_GRENADE_LAUNCHER)
{
self.weapon = IT_PIPE_BOMBS;
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.weapon == IT_PIPE_BOMBS)
//** PATCH_END - pipebombs ******
{
self.weapon = IT_ROCKET_LAUNCHER;
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.weapon == IT_ROCKET_LAUNCHER)
//** PATCH_BEGIN - flame thrower - Turrican ****
{
self.weapon = IT_FLAMETHROWER;
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.weapon == IT_FLAMETHROWER)
//** PATCH_BEGIN - flame thrower - Turrican ****
{
self.weapon = IT_LIGHTNING;
if (self.ammo_cells < 1)
am = 1;
}
//** PATCH_BEGIN - extra weapons - Turrican ****
if (self.weapon == IT_MORNINGSTAR ||
self.weapon == IT_THROWING_AXE ||
self.weapon == IT_LASER ||
self.weapon == IT_SUPER_LASER ||
self.weapon == IT_PIPE_BOMBS ||
self.weapon == IT_FLAMETHROWER ||
self.weapon == IT_TRACTOR_BEAM)
{
// Get EXTRA weapon number from weapon IT number.
if (self.weapon == IT_MORNINGSTAR)
extra_weapon = EXTRA_MORNINGSTAR;
else if (self.weapon == IT_THROWING_AXE)
extra_weapon = EXTRA_THROWING_AXE;
else if (self.weapon == IT_LASER)
extra_weapon = EXTRA_LASER;
else if (self.weapon == IT_SUPER_LASER && (self.items & IT_SUPER_SHOTGUN))
extra_weapon = EXTRA_SUPER_LASER;
else if (self.weapon == IT_PIPE_BOMBS && (self.items & IT_GRENADE_LAUNCHER))
extra_weapon = EXTRA_PIPE_BOMBS;
else if (self.weapon == IT_FLAMETHROWER && (self.items & IT_ROCKET_LAUNCHER))
extra_weapon = EXTRA_FLAMETHROWER;
else if (self.weapon == IT_TRACTOR_BEAM && (self.items & IT_LIGHTNING))
extra_weapon = EXTRA_TRACTOR_BEAM;
else
extra_weapon = EXTRA_NO_WEAPON;
if ( (self.extra_items & extra_weapon) && am == 0)
{
W_NotifyOfChange ();
W_SetCurrentAmmo ();
return;
}
}
else
{
if ( (self.items & self.weapon) && am == 0)
{
W_NotifyOfChange ();
W_SetCurrentAmmo ();
return;
}
}
//** PATCH_END - extra weapons - Turrican ******
}
};
/*
============
CycleWeaponReverseCommand
Go to the prev weapon with ammo
============
*/
void() CycleWeaponReverseCommand =
{
//** PATCH_BEGIN - extra weapons - Turrican ****
local float am;
local float extra_weapon;
//** PATCH_END - extra weapons - Turrican ******
self.impulse = 0;
while (1)
{
am = 0;
if (self.weapon == IT_LIGHTNING)
//** PATCH_BEGIN - flame thrower - Turrican ****
{
self.weapon = IT_FLAMETHROWER;
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.weapon == IT_FLAMETHROWER)
//** PATCH_END - flame thrower - Turrican ******
{
self.weapon = IT_ROCKET_LAUNCHER;
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.weapon == IT_ROCKET_LAUNCHER)
//** PATCH_BEGIN - pipebombs ****
{
self.weapon = IT_PIPE_BOMBS;
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.weapon == IT_PIPE_BOMBS)
//** PATCH_END - pipebombs ******
{
self.weapon = IT_GRENADE_LAUNCHER;
if (self.ammo_rockets < 1)
am = 1;
}
else if (self.weapon == IT_GRENADE_LAUNCHER)
{
self.weapon = IT_SUPER_NAILGUN;
if (self.ammo_nails < 2)
am = 1;
}
else if (self.weapon == IT_SUPER_NAILGUN)
{
self.weapon = IT_NAILGUN;
if (self.ammo_nails < 1)
am = 1;
}
else if (self.weapon == IT_NAILGUN)
{
//** PATCH_BEGIN - tchwpn10 - Turrican ****
self.weapon = IT_SUPER_LASER;
if (self.ammo_cells < 2)
am = 1;
}
else if (self.weapon == IT_SUPER_LASER)
{
self.weapon = IT_LASER;
if (self.ammo_cells < 1)
am = 1;
}
else if (self.weapon == IT_LASER)
{
//** PATCH_END - tchwpn10 - Turrican ******
self.weapon = IT_SUPER_SHOTGUN;
if (self.ammo_shells < 2)
am = 1;
}
else if (self.weapon == IT_SUPER_SHOTGUN)
{
self.weapon = IT_SHOTGUN;
if (self.ammo_shells < 1)
am = 1;
}
else if (self.weapon == IT_SHOTGUN)
{
//** PATCH_BEGIN - throwaxe - Turrican ****
//** PATCH_BEGIN - grap109b - Turrican ****
// Cycle the axes.
self.weapon = IT_MORNINGSTAR;
}
else if (self.weapon == IT_MORNINGSTAR && self.num_axes >= 1)
{
self.weapon = IT_THROWING_AXE;
}
else if ((self.weapon == IT_MORNINGSTAR) || (self.weapon == IT_THROWING_AXE))
{
//** PATCH_END - grap109b - Turrican ******
//** PATCH_END - throwaxe - Turrican ******
self.weapon = IT_AXE;
}
else if (self.weapon == IT_AXE)
{
//** PATCH_BEGIN - tracbeam - Turrican ****
self.weapon = IT_TRACTOR_BEAM;
if (self.ammo_cells < 1)
am = 1;
}
else if (self.weapon == IT_TRACTOR_BEAM)
{
//** PATCH_END - tracbeam - Turrican ******
self.weapon = IT_LIGHTNING;
if (self.ammo_cells < 1)
am = 1;
}
//** PATCH_BEGIN - extra weapons - Turrican ****
if (self.weapon == IT_MORNINGSTAR ||
self.weapon == IT_THROWING_AXE ||
self.weapon == IT_LASER ||
self.weapon == IT_SUPER_LASER ||
self.weapon == IT_PIPE_BOMBS ||
self.weapon == IT_FLAMETHROWER ||
self.weapon == IT_TRACTOR_BEAM)
{
// Get EXTRA weapon number from weapon IT number.
if (self.weapon == IT_MORNINGSTAR)
extra_weapon = EXTRA_MORNINGSTAR;
else if (self.weapon == IT_THROWING_AXE)
extra_weapon = EXTRA_THROWING_AXE;
else if (self.weapon == IT_LASER)
extra_weapon = EXTRA_LASER;
else if (self.weapon == IT_SUPER_LASER && (self.items & IT_SUPER_SHOTGUN))
extra_weapon = EXTRA_SUPER_LASER;
else if (self.weapon == IT_PIPE_BOMBS && (self.items & IT_GRENADE_LAUNCHER))
extra_weapon = EXTRA_PIPE_BOMBS;
else if (self.weapon == IT_FLAMETHROWER && (self.items & IT_ROCKET_LAUNCHER))
extra_weapon = EXTRA_FLAMETHROWER;
else if (self.weapon == IT_TRACTOR_BEAM && (self.items & IT_LIGHTNING))
extra_weapon = EXTRA_TRACTOR_BEAM;
else
extra_weapon = EXTRA_NO_WEAPON;
if ( (self.extra_items & extra_weapon) && am == 0)
{
W_NotifyOfChange ();
W_SetCurrentAmmo ();
return;
}
}
else
{
if ( (self.items & self.weapon) && am == 0)
{
W_NotifyOfChange ();
W_SetCurrentAmmo ();
return;
}
}
//** PATCH_END - extra weapons - Turrican ******
}
};
/*
============
ServerflagsCommand
Just for development
============
*/
void() ServerflagsCommand =
{
serverflags = serverflags * 2 + 1;
};
void() QuadCheat =
{
if (deathmatch || coop)
return;
self.super_time = 1;
self.super_damage_finished = time + 30;
self.items = self.items | IT_QUAD;
dprint ("quad cheat\n");
};
//** PATCH_BEGIN - extra cheats - Turrican ****
void() InvulnerabilityCheat =
{
if (deathmatch || coop)
return;
self.invincible_time = 1;
self.invincible_finished = time + 30;
self.items = self.items | IT_INVULNERABILITY;
dprint ("invulnerability cheat\n");
};
void() InvisibilityCheat =
{
if (deathmatch || coop)
return;
self.invisible_time = 1;
self.invisible_finished = time + 30;
self.items = self.items | IT_INVISIBILITY;
dprint ("invisibility cheat\n");
};
void() BiosuitCheat =
{
if (deathmatch || coop)
return;
self.rad_time = 1;
self.radsuit_finished = time + 30;
self.items = self.items | IT_SUIT;
dprint ("biosuit cheat\n");
};
//** PATCH_END - extra cheats - Turrican ******
//** PATCH_BEGIN - quickfire - Turrican ****
// Functions to change to a weapon, fire it once and return to the previous
// weapon.
void() FireOneRocket =
{
if (!(self.items & IT_ROCKET_LAUNCHER))
{ // don't have the weapon
sprint (self, "no weapon\n");
return;
}
if (self.ammo_rockets < 1)
{ // don't have the ammo
sprint (self, "not enough ammo\n");
return;
}
self.quickfire = 1;
self.prev_weapon = self.weapon;
self.weapon = IT_ROCKET_LAUNCHER;
W_NotifyOfChange ();
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_rock2.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
W_Attack ();
};
void() FireOneGrenade =
{
if (!(self.items & IT_GRENADE_LAUNCHER))
{ // don't have the weapon
sprint (self, "no weapon\n");
return;
}
if (self.ammo_rockets < 1)
{ // don't have the ammo
sprint (self, "not enough ammo\n");
return;
}
self.quickfire = 1;
self.prev_weapon = self.weapon;
self.weapon = IT_GRENADE_LAUNCHER;
W_NotifyOfChange ();
self.currentammo = self.ammo_rockets;
self.weaponmodel = "progs/v_rock.mdl";
self.weaponframe = 0;
self.items = self.items | IT_ROCKETS;
W_Attack ();
};
void() FireOneAxe =
{
self.quickfire = 1;
self.prev_weapon = self.weapon;
self.weapon = IT_AXE;
W_NotifyOfChange ();
self.currentammo = 0;
self.weaponmodel = "progs/v_axe.mdl";
self.weaponframe = 0;
W_Attack ();
};
void() FireOneThrowAxe =
{
if (self.num_axes < 1)
{ // don't have the ammo
sprint (self, "not enough ammo\n");
return;
}
self.quickfire = 1;
self.prev_weapon = self.weapon;
self.weapon = IT_THROWING_AXE;
W_NotifyOfChange ();
self.currentammo = self.num_axes;
self.weaponmodel = "progs/v_axe.mdl";
self.weaponframe = 0;
W_Attack ();
};
//** PATCH_END - quickfire - Turrican ******
/*
============
ImpulseCommands
============
*/
//** PATCH_BEGIN - morph2 ****
void() player_zombie_become;
void() player_shalrath_become;
void() player_human_become;
void() player_wizard_become;
void() player_hknight_become;
void() player_shambler_become;
void() player_demon_become;
void() player_ogre_become;
//** PATCH_BEGIN - morph2 ****
void() ImpulseCommands =
{
//** PATCH_BEGIN - grenades - Turrican ****
local string s;
//** PATCH_END - grenades - Turrican ******
//** PATCH_BEGIN - quickfire - Turrican ****
if (self.quickfire)
{
if (self.attack_finished < time)
{
self.weapon = self.prev_weapon;
W_NotifyOfChange ();
W_SetCurrentAmmo ();
self.quickfire = 0;
}
self.impulse = 0;
}
//** PATCH_END - quickfire - Turrican ******
//** PATCH_BEGIN - morph2 ****
// Executes impulses 1 to 10 for non human morphed players.
if (self.impulse >= 1 && self.impulse <= 12 && self._impulse != SUB_Null)
{
self._impulse();
return;
}
//** PATCH_END - morph2 ******
//** PATCH_BEGIN - general change - Turrican ****
if (self.impulse >= 1 && self.impulse <= 10)
W_ChangeWeapon ();
else if (self.impulse == 11)
CycleWeaponCommand ();
else if (self.impulse == 12)
CycleWeaponReverseCommand();
else if (self.impulse == 13)
CheatCommand ();
else if (self.impulse == 14)
ServerflagsCommand ();
//** PATCH_BEGIN - grap109b - morph2 - Turrican ****
else if (self.impulse == 100 && self.morphnum == M_HUMAN)
W_ChangeWeapon();
//** PATCH_END - grap109b - morph2 - Turrican ******
//** PATCH_BEGIN - morph2 - Turrican ****
// Cycle morph.
else if (self.impulse == 101 || self.impulse == 102)
{
if (self.impulse == 101)
{
self.morphnum = self.morphnum + 1;
if (self.morphnum >= 8)
{
self.morphnum = 0;
}
}
else
{
self.morphnum = self.morphnum - 1;
if (self.morphnum <= -1)
{
self.morphnum = 7;
}
}
if (self.morphnum == M_HUMAN) player_human_become();
else if (self.morphnum == M_ZOMBIE) player_zombie_become();
else if (self.morphnum == M_SHALRATH) player_shalrath_become();
else if (self.morphnum == M_WIZARD) player_wizard_become();
else if (self.morphnum == M_HKNIGHT) player_hknight_become();
else if (self.morphnum == M_SHAMBLER) player_shambler_become();
else if (self.morphnum == M_DEMON) player_demon_become();
else if (self.morphnum == M_OGRE) player_ogre_become();
}
//** PATCH_END - morph2 - Turrican ******
//** PATCH_BEGIN - pipebombs ****
else if(self.impulse == 103 && self.morphnum == M_HUMAN)
DetPipeBombs();
//** PATCH_END - pipebombs ****
//** PATCH_BEGIN - grenades - Turrican ****
else if((self.impulse == 104 || self.impulse == 105) &&
self.morphnum == M_HUMAN)
{
if(self.impulse == 104)
self.grenade_time = self.grenade_time + 0.5;
else
self.grenade_time = self.grenade_time - 0.5;
if(self.grenade_time < 0.5)
self.grenade_time = 0.5;
else if(self.grenade_time > 10)
self.grenade_time = 10;
s = ftos(self.grenade_time);
sprint(self, "Grenade fuse set to ");
sprint(self, s);
if(self.grenade_time == 1)
sprint(self, " second\n");
else
sprint(self, " seconds\n");
}
//** PATCH_END - grenades - Turrican ******
//** PATCH_BEGIN - lazsight - Turrican ****
else if (self.impulse == 106 && self.morphnum == M_HUMAN)
{
LaserTargeterToggle(self);
}
//** PATCH_END - lazsight - Turrican ******
//** PATCH_BEGIN - no suicides in deathmatch - Turrican ****
else if (self.impulse == 107)
{
if (deathmatch)
return;
localcmd("kill");
}
//** PATCH_END - no suicides in deathmatch - Turrican ******
//** PATCH_BEGIN - quickfire - Turrican ****
// Impulses to change to a weapon, fire it once, and return to your previous
// weapon.
// Rocket launcher
else if (self.impulse == 108 && self.morphnum == M_HUMAN)
{
FireOneRocket();
}
// Grenade launcher
else if (self.impulse == 109 && self.morphnum == M_HUMAN)
{
FireOneGrenade();
}
// Axe
else if (self.impulse == 110 && self.morphnum == M_HUMAN)
{
FireOneAxe();
}
// Trowing axe
else if (self.impulse == 111 && self.morphnum == M_HUMAN)
{
FireOneThrowAxe();
}
//** PATCH_END - quickfire - Turrican ******
//** PATCH_BEGIN - mskin12 - Turrican ****
if ((self.impulse == 200) || (self.impulse == 201) &&
self.morphnum == M_HUMAN)
{
// Cycle the player skin number.
if (self.impulse == 200)
{
self.skin = self.skin + 1;
if ((self.skin >= 25 && self.netname != "AeNiMa") || (self.skin >= 26))
{
self.skin = 0;
}
}
else
{
self.skin = self.skin - 1;
if (self.skin <= -1 && self.netname == "AeNiMa")
{
self.skin = 25;
}
else if (self.skin <= -1)
{
self.skin = 24;
}
}
// Change the player skin.
if (self.skin == 0)
{
centerprint(self, "SKIN: Quake Player (1)");
// Restore player colors.
if (self.colormap == 0)
{
self.colormap = self.temp_colormap;
}
}
else if (self.skin == 1)
{
centerprint(self, "SKIN: Duke Nukem (2)");
// Make the skins ignore player colors.
// (Assuming that the cycling method here stays the same.)
if (self.colormap != 0)
{
self.temp_colormap = self.colormap;
self.colormap = 0;
}
}
else if (self.skin == 2) centerprint(self, "SKIN: Dark Toad (3)"); else
if (self.skin == 3) centerprint(self, "SKIN: Stormtrooper (4)"); else
if (self.skin == 4) centerprint(self, "SKIN: Han Solo (5)"); else
if (self.skin == 5) centerprint(self, "SKIN: Wizard (6)"); else
if (self.skin == 6) centerprint(self, "SKIN: Judge Dredd (7)"); else
if (self.skin == 7) centerprint(self, "SKIN: C3PO (8)"); else
if (self.skin == 8) centerprint(self, "SKIN: Captain Picard (9)"); else
if (self.skin == 9) centerprint(self, "SKIN: Bossk (10)"); else
if (self.skin == 10) centerprint(self,"SKIN: the Predator (11)"); else
if (self.skin == 11) centerprint(self,"SKIN: Skeleton (12)"); else
if (self.skin == 12) centerprint(self,"SKIN: Wan-Fu (13)"); else
if (self.skin == 13) centerprint(self,"SKIN: Valkyrie Warrior (14)"); else
if (self.skin == 14) centerprint(self,"SKIN: the Avatar (15)"); else
if (self.skin == 15) centerprint(self,"SKIN: Boba Fett (16)"); else
if (self.skin == 16) centerprint(self,"SKIN: NYPD Cop (17)"); else
if (self.skin == 17) centerprint(self,"SKIN: Quake Enforcer (18)"); else
if (self.skin == 18) centerprint(self,"SKIN: Jason (19)"); else
if (self.skin == 19) centerprint(self,"SKIN: Crusader - No Remorse (20)"); else
if (self.skin == 20) centerprint(self,"SKIN: White Knight (21)"); else
if (self.skin == 21) centerprint(self,"SKIN: Quake biosuit (22)"); else
if (self.skin == 22) centerprint(self,"SKIN: the Punisher (23)"); else
if (self.skin == 23) centerprint(self,"SKIN: Ninja (24)"); else
if (self.skin == 24)
{
centerprint(self,"SKIN: the Spawn (25)");
// Make the skins ignore player colors.
// (Assuming that the cycling method here stays the same.)
if (self.colormap != 0)
{
self.temp_colormap = self.colormap;
self.colormap = 0;
}
}
else if (self.skin == 25)
{
centerprint(self,"SKIN: AeNiMa (26)");
// Make the skins ignore player colors.
// (Assuming that the cycling method here stays the same.)
if (self.colormap != 0)
{
self.temp_colormap = self.colormap;
self.colormap = 0;
}
}
}
//** PATCH_END - mskin12 - Turrican ******
//** PATCH_BEGIN - extra cheats - Turrican ****
else if (self.impulse == 251)
{
BiosuitCheat();
InvisibilityCheat();
QuadCheat();
InvulnerabilityCheat();
}
else if (self.impulse == 252)
BiosuitCheat ();
else if (self.impulse == 253)
InvisibilityCheat ();
else if (self.impulse == 254)
InvulnerabilityCheat ();
//** PATCH_END - extra cheats - Turrucan ******
else if (self.impulse == 255)
QuadCheat ();
//** PATCH_END - general change - Turrican ******
self.impulse = 0;
};
/*
============
W_WeaponFrame
Called every frame so impulse events can be handled as well as possible
============
*/
void() W_WeaponFrame =
{
//** PATCH_BEGIN - grap109b ****
// if ( (time < self.attack_finished) || (self.hook_out))
//** PATCH_END - grap109b ******
if (time < self.attack_finished)
return;
ImpulseCommands ();
// check for attack
if (self.button0)
{
SuperDamageSound ();
W_Attack ();
}
};
/*
========
SuperDamageSound
Plays sound if needed
========
*/
void() SuperDamageSound =
{
if (self.super_damage_finished > time)
{
if (self.super_sound < time)
{
self.super_sound = time + 1;
sound (self, CHAN_BODY, "items/damage3.wav", 1, ATTN_NORM);
}
}
return;
};